#include "spectrumdatafileprivatedefine.h"

namespace DataSpecificationGW
{

    SpectrumDataFileHeadPrivate::SpectrumDataFileHeadPrivate()
    {
        iFileLength = 0;
        bSkipFileLength = false;
        bHasFileLength = false;

        qstrVersion = "1.1.0.0";
        bSkipVersion = false;
        bHasVersion = false;

        bSkipGenerationTime = false;
        bHasGenerationTime = false;

        bSkipStationName = false;
        bHasStationName = false;

        bSkipStationCode = false;
        bHasStationCode = false;

        ucWeather = 255;
        bSkipWeather = false;
        bHasWeather = false;

        fTemperature = 0.0;
        bSkipTemperature = false;
        bHasTemperature = false;

        cHumidity = 0;
        bSkipHumidity = false;
        bHasHumidity = false;

        bSkipInstrumentManufacturer = false;
        bHasInstrumentManufacturer = false;

        bSkipInstrumentModel = false;
        bHasInstrumentModel = false;

        bSkipInstrumentVersion = false;
        bHasInstrumentVersion = false;

        bSkipInstrumentSerialNumber = false;
        bHasInstrumentSerialNumber = false;

        fSystemFrequency = 50;
        bSkipSystemFrequency = false;
        bHasSystemFrequency = false;

        sSpectrumCount = 0;
        bSkipSpectrumCount = false;
        bHasSpectrumCount = false;

        bSkipCompanyCode = false;
        bHasCompanyCode = false;

        bSkipInternalVersion = false;
        bHasInternalVersion = false;
    }

    SpectrumDataFileHeadPrivate& SpectrumDataFileHeadPrivate::operator=(const SpectrumDataFileHeadPrivate& stSpectrumDataFileHeadPrivate)
    {
        this->iFileLength = stSpectrumDataFileHeadPrivate.iFileLength;
        this->qstrVersion = stSpectrumDataFileHeadPrivate.qstrVersion;
        this->qstrGenerationTime = stSpectrumDataFileHeadPrivate.qstrGenerationTime;
        this->qstrStationName = stSpectrumDataFileHeadPrivate.qstrStationName;
        this->qstrStationCode = stSpectrumDataFileHeadPrivate.qstrStationCode;
        this->ucWeather = stSpectrumDataFileHeadPrivate.ucWeather;
        this->fTemperature = stSpectrumDataFileHeadPrivate.fTemperature;
        this->cHumidity = stSpectrumDataFileHeadPrivate.cHumidity;
        this->qstrInstrumentManufacturer = stSpectrumDataFileHeadPrivate.qstrInstrumentManufacturer;
        this->qstrInstrumentModel = stSpectrumDataFileHeadPrivate.qstrInstrumentModel;
        this->qstrInstrumentSerialNumber = stSpectrumDataFileHeadPrivate.qstrInstrumentSerialNumber;
        this->qstrInstrumentVersion = stSpectrumDataFileHeadPrivate.qstrInstrumentVersion;
        this->fSystemFrequency = stSpectrumDataFileHeadPrivate.fSystemFrequency;
        this->sSpectrumCount = stSpectrumDataFileHeadPrivate.sSpectrumCount;
        this->qstrCompanyCode = stSpectrumDataFileHeadPrivate.qstrCompanyCode;
        this->qstrInternalVersion = stSpectrumDataFileHeadPrivate.qstrInternalVersion;
        return *this;
    }

    bool SpectrumDataFileHeadPrivate::operator==(const SpectrumDataFileHeadPrivate& stSpectrumDataFileHeadPrivate) const
    {
        if (!(this->iFileLength == stSpectrumDataFileHeadPrivate.iFileLength)) return false;
        if (!(this->qstrVersion == stSpectrumDataFileHeadPrivate.qstrVersion)) return false;
        if (!(this->qstrGenerationTime == stSpectrumDataFileHeadPrivate.qstrGenerationTime)) return false;
        if (!(this->qstrStationName == stSpectrumDataFileHeadPrivate.qstrStationName)) return false;
        if (!(this->qstrStationCode == stSpectrumDataFileHeadPrivate.qstrStationCode)) return false;
        if (!(this->ucWeather == stSpectrumDataFileHeadPrivate.ucWeather)) return false;
        if (!qFuzzyCompare(this->fTemperature, stSpectrumDataFileHeadPrivate.fTemperature)) return false;
        if (!(this->cHumidity == stSpectrumDataFileHeadPrivate.cHumidity)) return false;
        if (!(this->qstrInstrumentManufacturer == stSpectrumDataFileHeadPrivate.qstrInstrumentManufacturer)) return false;
        if (!(this->qstrInstrumentModel == stSpectrumDataFileHeadPrivate.qstrInstrumentModel)) return false;
        if (!(this->qstrInstrumentSerialNumber == stSpectrumDataFileHeadPrivate.qstrInstrumentSerialNumber)) return false;
        if (!(this->qstrInstrumentVersion == stSpectrumDataFileHeadPrivate.qstrInstrumentVersion)) return false;
        if (!qFuzzyCompare(this->fSystemFrequency, stSpectrumDataFileHeadPrivate.fSystemFrequency)) return false;
        if (!(this->sSpectrumCount == stSpectrumDataFileHeadPrivate.sSpectrumCount)) return false;
        if (!(this->qstrCompanyCode == stSpectrumDataFileHeadPrivate.qstrCompanyCode)) return false;
        if (!(this->qstrInternalVersion == stSpectrumDataFileHeadPrivate.qstrInternalVersion)) return false;
        return true;
    }

    SpectrumDataFileTailPrivate::SpectrumDataFileTailPrivate()
    {
        iCRC32 = 0;
        bSkipCRC32 = false;
        bHasCRC32 = false;
    }

    SpectrumDataFileTailPrivate& SpectrumDataFileTailPrivate::operator=(const SpectrumDataFileTailPrivate& stSpectrumDataFileTailPrivate)
    {
        this->iCRC32 = stSpectrumDataFileTailPrivate.iCRC32;
        return *this;
    }

    bool SpectrumDataFileTailPrivate::operator==(const SpectrumDataFileTailPrivate& stSpectrumDataFileTailPrivate) const
    {
        if (!(this->iCRC32 == stSpectrumDataFileTailPrivate.iCRC32)) return false;
        return true;
    }

}
